 import axios from "../utils/request.js";


export const userListReq = (currentPage, pageSize) => {
    return axios.get("/users/list", {
        params: {
            currentPage,
            pageSize
        }
    });
}

// 请求用户个人信息的api函数
export const userInfoReq = () => {
    // get会返回一个promise
    return axios.get('/users/info')
}


// 添加
export const userAddReq = (data) => axios.post('/users/add', data)

// 删除
export const userDelReq = (id) => axios.get('/users/del', {
    params: { id }
})

// 批量删除
export const userBatchdelReq = (ids) => axios.get('/users/batchdel', {
    params: { ids: ids }
})

// 修改账号
export const editUserInfo = data => axios.post('/users/edit', data)

// 修改密码
export const editpwd = data => axios.post('/users/editpwd', data)

// 上传头像
export const avatareditReq = (imgUrl) => axios.get('/users/avataredit', {
    params: { imgUrl }
})

